var detailVm;
var getDetails;
window.onload = function () {

    getDetails=function(id){
        _getHttpsData2('/enterprise/details?enterpriseId='+id,'',
           function(res){
               console.log(JSON.stringify(res))
               if(res.attachs && res.attachs.length>0){
               		for(var i=0;i<res.attachs.length;i++){
               			if(res.attachs[i].attFkName=='t_enterprise_env'){
               				detailVm.cover=res.attachs[i].attWebUrl;
               			}
               		}              		
               }
               detailVm.detailInfo=res;
           },
           function(err){         	
                vant.Toast.fail("网络异常"+err.readyState+":"+err.statusText+"("+err.status+")");
           }
       );
    }
	
	
	GetRequest=function() {
	   var url = location.search; //获取url中"?"符后的字串
	   var theRequest = new Object();
	   if (url.indexOf("?") != -1) {
		  var str = url.substr(1);
		  strs = str.split("&");
		  for(var i = 0; i < strs.length; i ++) {
			 theRequest[strs[i].split("=")[0]]=(strs[i].split("=")[1]);
		  }
	   }
	   return theRequest;
	}
	
	onClosePage=function(){
	    window.history.back();
	},
 	

    detailVm = new Vue({
        el:'#order_id',
        data:{          
            detailInfo:'',
            cover:''
        }
    });
    
	var urlParam=GetRequest();
	if(urlParam){
		if(urlParam.id){
			getDetails(urlParam.id);
		}
	}      
    
};